package com.ms.db.usertype;
import com.xpec.c4.game.utility.GUID;

public class GUIDToString extends BasicToString {

	/**
	 *
	 */
	private static final long serialVersionUID = 5338913846437378872L;

	@Override
	protected String assemble(Object obj) {
		if (obj != null) {
			return ((GUID) obj).toString();
		} else {
			return null;
		}
	}

	@Override
	protected Object parse(String value) {
		if (value == null) {
			return null;
		}
		return GUID.parseUUID(value);
	}

	@Override
	public Class<?> returnedClass() {
		return GUID.class;
	}

	@Override
	public int[] sqlTypes() {
		return VARCHAR_TYPES;
	}

}
